<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Add / remove CSS class dynamically</title>
<style type="text/css">
	.highlight { 
		background:green;
	}
 </style>
<script type="text/javascript" src="../jquery-1.11.0.js"></script>
<script type="text/javascript">

	$(document).ready(function() {
		
		$("#addClass").click(function() {
			$("#para1").addClass("highlight");
		});
		
		$("#removeClass").click(function() {
			$("#para1").removeClass("highlight");
		});
	});
	
</script>
</head>
<body>
	<h1>jQuery add / remove CSS class example</h1>
 
	<p id="para1">This is paragraph 1</p>
 	<p>This is paragraph 2</p>
 	<p>This is paragraph 3</p>
 	<p>This is paragraph 4</p>
 
	<button id="addClass">Add highlight</button>
	<button id="removeClass">Remove highlight</button>
	
	<br><br><a href="index.jsp">retour</a>
</body>
</html>